package ${classPath};
 
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

/** 
 * @author fox
 *
 */
<#assign instance="${domain?substring(0,1)?lower_case}${domain?substring(1)}"/>
@Data
@ToString
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ${domain}TestBuilder{
 
<#list fieldList as field>
  /** ${field.comment} */
  private ${field.type} ${field.name};

</#list>


  public ${domain} generate() {
    ${domain} ${instance} = new ${domain}();
    <#list fieldList as field>
      //${field.comment}
      ${instance}.set${field.name?cap_first}(${field.name});
    </#list>
    return ${instance} ;
  }
  
  public static ${domain}TestBuilder getInstance() {
    return ${domain}TestBuilder.builder()//
    <#list fieldList as field>
    <#if field.type="String">
        .${field.name}("${field.name}")//${field.name} ${field.comment}
    <#elseif field.type="Long">
        .${field.name}(10000l)//${field.name} ${field.comment}
    <#elseif field.type="Integer">
        .${field.name}(1000)//${field.name} ${field.comment}
    <#elseif field.type="Double">
        .${field.name}(100d)//${field.name} ${field.comment}
    <#elseif field.type="Amount">
        .${field.name}(new Amount(100))//${field.name} ${field.comment}
    <#elseif field.type="LocalDate">
        .${field.name}(LocalDate.of(2003, 10, 20))//${field.name} ${field.comment}
    <#elseif field.type="LocalDateTime">
        .${field.name}(LocalDateTime.now())//${field.name} ${field.comment}
    <#else>
        .${field.name}(new ${field.type}())//${field.type} ${field.comment}
    </#if>
    </#list>
    .build();
  }
}
